package com.ctrip.cap.client.statistics;

import com.ctrip.cap.client.impl.base.BaseClient;
import com.ctrip.cap.client.impl.base.BaseClientImpl.HttpMethodType;

public class CapStatisticsServiceClientImpl extends BaseClient {
	private final static String BASE_PATH = "/service/statistics";
	private final static String SYNC_BY_RUNID = "/sync-by-runid";
	
	public CapStatisticsServiceClientImpl() {
		baseUrl = "http://localhost:8080/cap-data-server";
	}
	
	public CapStatisticsServiceClientImpl(String serverUrl) {
		baseUrl = serverUrl;
	}
	
	public float syncByRunID(long runid) {
		return this.baseCall(BASE_PATH+SYNC_BY_RUNID, runid , HttpMethodType.GET, Float.class, "runId");		
	}
	
	public static void main(String[] args) throws InterruptedException {
		long[] runIdlist = {11274,11317,11318,11319,
				11321,11322,11577,11583};
		CapStatisticsServiceClientImpl clientImpl = new CapStatisticsServiceClientImpl();
		for(long runid : runIdlist) {
			clientImpl.syncByRunID(runid);
		}
	}
}
